package com.zyz.C_数组.练习;

/**
 * @author: vick
 * @Date: 2025/3/13
 * @Description:
 * @version: 1.0
 */
public class Demo3 {
    public static void main(String[] args) {
        int[] nums = {10, 20, 5, 40, 15};

        //创建反转数组
        int[] reversed = new int[nums.length]; //0 , 1, 2, 3, 4

        for (int i = 0; i < nums.length; i++) {
            reversed[i] = nums[nums.length - 1 - i];
        }

        for (int num : reversed) {
            System.out.println(num);
        }
    }
}
